<?php
namespace app\api\controller\question;
use app\common\annotation\ApiNodeAnnotation;
use app\common\controller\ApiBase;
use app\question\model\QuestionExam;

/**
 * @ApiNodeAnnotation(
 *     title="考试板块",
 *      parent="api/question.index",
 *     is_release=0,
 *     auth=1,
 * )
 */
class Exam extends ApiBase{

    /**
     * @ApiNodeAnnotation(
     *     title="考试列表",
     *     parent="api/question.exam",
     *     is_release=1,
     *     auth=1,
     * )
     */
    public function index()
    {
        $examList = (new QuestionExam())
            ->order('id','desc')
            ->limit($this->request->param("limit",15,'intval'))
            ->field('id,title,FROM_UNIXTIME(start_time,"%Y-%m-%d") as start_date,FROM_UNIXTIME(end_time,"%Y-%m-%d") as end_date,status')
            ->page($this->request->param('page',1,'intval'))
            ->select();
        $this->success("考试列表清单",'',$examList);
    }


    
}